package com.cy.demo.service;

import com.cy.demo.pojo.Address;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.security.PrivateKey;
import java.util.List;

public interface IAddressService {
    //添加新地址
    void addNewAddress(int uid, String username, Address address);

    /**
     *
     * @param uid 用户id
     * @return 地址List
     */
    //展示当前用户的所有地址
    List<Address> showAddressesByUid(int uid);

    /**
     *
     * @param aid 地址id
     * @param uid 用户id
     * @param username 修改者
     */
    //更新默认地址
    void setDefault(int aid,
                    int uid,
                    String username);

    /**
     * 删除地址
     * @param aid 地址id
     * @throws Exception 删除异常
     */
    void deleteByAid(int aid) throws Exception;

    /**
     *
     * @param address 修改之后拼接成的address对象
     */
    void updateByAid(String username, Address address);



    Address getByAid(Integer aid, Integer uid);

}
